﻿namespace Shortcuts.Common
{
    public enum Settings
    {
        WiFi,
        Bluetooth,
        Cellular,
        AirplaneMode,
        Location,
        Lock,

        None = 9999
    }

    public static class SettingsExtensions
    {
        public static string Localized(this Settings settings)
        {
            return settings.ToString("G").Localized();
        }

        public static string ToSettingsUrl(this Settings settings)
        {
            return string.Format("ms-settings-{0:G}:", settings).ToLower();
        }

        public static Tile ToTile(this Settings settings)
        {
            Tile tile = null;
            switch (settings)
            {
                case Settings.AirplaneMode:
                    tile = new AirplaneMode();
                    break;
                case Settings.Bluetooth:
                    tile = new Bluetooth();
                    break;
                case Settings.Cellular:
                    tile = new Cellular();
                    break;
                case Settings.WiFi:
                    tile = new WiFi();
                    break;
                case Settings.Location:
                    tile = new Location();
                    break;
                case Settings.Lock:
                    tile = new Lock();
                    break;
            }

            return tile;
        }
    }
}
